﻿<!doctype html>
<html>
<!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>客户提醒</title>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/shopSelecterNew.js"></script>
<script type="text/javascript" src="../js/pagination.js"></script>
<script type="text/javascript" src="../js/find.js"></script>
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script type="text/javascript" >

$(function(){
	refreshInput($(".serWrapper"));
	$("#shopIsChoosed").click(function(){
		if($("#shopIsChoosed").is(":checked")){
			$("#shopName").attr("disabled",false);
			$("#research").attr("disabled",false);
			
		}else{
			$("#shopName").attr("disabled",true);

		}
	});
	getRemindType()
	 $('#dtBegin').val(getToday());
	 $('#dtEnd').val(getToday());
})
var pagecount = 0;
var count = 0;
var shopId="shopId";



function InitTable(pageIndex ) {
	if(IsNotEmpty(pageIndex)){
		_pageIndex = pageIndex;
	}
	var license=$("#license").val().replace(/\s/gi,'');	
	var custName=$("#custName").val().replace(/\s/gi,'');
	var mp=$("#mp").val().replace(/\s/gi,'');
	var memberCardNo=$("#memberCardNo").val().replace(/\s/gi,'');
	var status=$("#status").val();
	var dtBegin=$("#dtBegin").val();
	var dtEnd=$("#dtEnd").val();
	var type=$("#type").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){	
	var	shopIds=$("#shopName").val();	
		if(shopIds!=""&&shopIds!=null){
			shopId = shopIds
		}
	}
	var param={'license':license,'custName':custName,'mp':mp,'memberCardNo':memberCardNo,'status':status,'dtBegin':dtBegin,'dtEnd':dtEnd,'type':type,'shopId':shopId}//'phone='+phone+'&code='+code+"&status="+status+"&dtBegin="+dtBegin+"&dtEnd="+dtEnd;
	
	var dt = _findInfo("../taskRemind/find/taskRemindList/" + ( _pageIndex -1 ) + "/10", param);
				if(dt.state==0){
					var params = new Array("shopName", "CreateTime","RemindName","TaskMemo","memberCardNo", "CustName", "Mp", "License",  "staName");							
					_loadInfo(dt, "memberList", params);
					_loadPage("pager", _pageIndex, 10, dt, InitTable,"NoResult")
					$("#sup").html("共"+dt.result.len+"条");		
				}	
}


function search(){
	InitTable(1);
}

function  downRescouse(){
	var license=$("#license").val().replace(/\s/gi,'');	
	var custName=$("#custName").val().replace(/\s/gi,'');
	var mp=$("#mp").val().replace(/\s/gi,'');
	var memberCardNo=$("#memberCardNo").val().replace(/\s/gi,'');
	var status=$("#status").val();
	var dtBegin=$("#dtBegin").val();
	var dtEnd=$("#dtEnd").val();
	var type=$("#type").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){	
	var	shopIds=$("#shopName").val();	
		if(shopIds!=""&&shopIds!=null){
			shopId = shopIds
		}
	}
	
	var param='license='+encodeURIComponent(license)+'&custName='+encodeURIComponent(custName)+"&memberCardNo="+encodeURIComponent(memberCardNo)+"&dtBegin="+dtBegin+"&dtEnd="+dtEnd+"&status="+
				status+"&type="+type+"&shopId="+shopId+"&downType=15";	
	
	window.location.href="../csvdown/down/csv/down?"+param

}

function getRemindType(){
	var dt = _findInfo("../remindSet/find/allSetting", null);
	if(dt.state==0){
		var params = new Array("shopName","RemindName", "CreateTime","TaskMemo","memberCardNo", "CustName", "Mp", "License",  "staName");
		for ( var i = 0; i < dt.result.data.length; i++) {
			var htm ="<option value=\""+ _getIntOfJson(i, dt, "id")+"\">"+_getStringOfJson(i, dt, "name")+"</option>"
			$("#type").append(htm);
		}
			
	}
}


</script>
</head>

<body>

<!-- InstanceBeginEditable name="EditRegion3" --> 
<script type="text/javascript" src="../js/doubleDate2.0.js"></script> 
<script type="text/javascript">
$(function(){
	
	$('.doubledate').kuiDate({
		className:'doubledate',
		isDisabled: "0"  // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
	});

});
</script>


<div id="yinying1"></div>
<div id="remindTypeDiv" class="hideDiv"  style=" width:650px;background:#fff;z-index:400;"  >
	 <div style="float:right;margin-bottom:5px;width:20px;height:20px;line-height:20px;text-align:center;background-color:#eee;margin-bottom:5px;border:1px solid #ccc;" > <span style="cursor: pointer;font-size: 14px;" onclick="closeShopShow();" >X</span> </div>
    <div class="bottom_search"><input type="text" id="searchName"><input type="button" style="width:auto;margin-left:5px;" value="查询" onclick="search2()"></div>
    <table   id="shopList" cellpadding="4" cellspacing="0" border="1" width="100%">
    <thead>
    <tr>
    <th>店面ID</th>
    <th>店面名称</th>
    <th>电话</th>
    <th>操作</th>
    </tr>
    </thead>
    </table>
    	<div id="shopPager"></div>
</div>
<div class="container" id="container">
  <div class="container_R fr">
    <div class="place">客户提醒</div>
    <div class="member_search">
      <p><span>
        <input type="checkbox" id="shopIsChoosed" style="width:auto;height:auto;border:none;">
        店面：</span>
        <select id="shopName" onclick="openShopListPanel(this)" style=";height:20px;width: 140px;" disabled="disabled">
        </select>
        <span>起始日期：</span>
        <input type="text" readonly class="doubledate ipticon"  id="dtBegin"/>
        <span>截止时间：</span>
        <input type="text" readonly class="doubledate ipticon" id="dtEnd"/>
      </p>
       <p>
        <span>提醒类型：</span>
      <select id="type">
        <option value="">所有</option>
      </select>
      <span>车牌号：</span>
      <input type="text" id="license" class="absoluteTxt">
      <span>姓名：</span>
             <input type="text" id="custName" class="absoluteTxt">
      </p>
      <p>
        <span>卡号：</span>
        <input type="text" id="memberCardNo" class="absoluteTxt">
      <span>手机号：</span>
      <input type="text" id="mp" class="absoluteTxt">
      <span>状态：</span>
      <select id="status">
        <option value="">所有</option>
        <option value="0">未分配</option>
        <option value="1">已分配</option>
      </select>
      <input type="button" value="查询" class="btn" onclick="search()">
      </p>
    </div>
    <table width="100%" class="member_list" cellpadding="0" cellspacing="1" border="0" id="memberList">
      <caption>
      <strong>客户提醒列表 <span id="sup">共0条</span> </strong><a href="javascript:void(0)" onclick="downRescouse()">导出数据</a>
      </caption>
      <thead>
        <tr>
          <th>店面</th>
          <th>提醒日期</th>
          <th>提醒类型</th>
          <th>提醒内容</th>
<!--           <th>单据号</th>
 -->          <th>卡号</th>
          <th>姓名</th>
          <th>手机号</th>
          <th>车牌号</th>
          <th>状态</th>
        </tr>
      </thead>
      <tbody></tbody>
    </table>
     <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" style="float: right;"></div>
  </div>
  <div class="fc"></div>
</div>
<!-- InstanceEndEditable --> 
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
clearThis("absoluteTxt");
showTab(4,9);
</script>
</body>
<!-- InstanceEnd -->
</html>
